Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clj-kondo hooks #135

Merged
merged 1 commit into from
Dec 9, 2020
Merged

clj-kondo hooks #135

merged 1 commit into from
Dec 9, 2020

Conversation

sogaiu
Copy link

@sogaiu sogaiu commented Nov 8, 2020

This PR is an attempt at providing support for clj-kondo hooks in libpython-clj. For details on the specific hooks please see: clj-python/clj-template#9

The idea here is to bundle the hooks with libpython-clj itself so that users can obtain the relevant hook code from the library (whether it's via a .jar or a git dep) itself and not have to go looking elsewhere nor figure out which version of the hook code is appropriate.

Note that getting the hook code into place and activated in one's project is a process that involves user intervention -- it is not just a matter of obtaining libpython-clj or updating a libpython-clj dependency.

The process subsequent to updating libpython-clj is basically:

  1. Ensure there is already a .clj-kondo directory in the project's top-level directory
  2. Execute an appropriate clj-kondo command to copy hooks code from the library to beneath the .clj-kondo directory
  3. Possibly create / edit .clj-kondo/config.edn appropriately

The following comment contains a log of this process for libpython-clj: clj-kondo/config#1 (comment) [1]

Documentation for this feature can be found at: https://github.com/borkdude/clj-kondo/blob/master/doc/config.md#Exporting-and-importing-configuration

Note that versions of clj-kondo earlier than v2020.11.07 are not likely to work.


[1] Slight gotcha with the instructions -- initially I used "clj_python" as a directory name, but was told this could be "clj-python". This change has been reflected in this PR.

@cnuernber
Copy link
Collaborator

@sogaiu - is this ready to merge?

@sogaiu
Copy link
Author

sogaiu commented Nov 23, 2020

Was thinking it might be good to have at least one report of success for at least one other person, but haven't heard of any tests yet.

I think @jjtolton said he might have some time in December.

WDYT?

@cnuernber
Copy link
Collaborator

If you are happy I am happy. I don't use Kondo and I definitely understand wanting another user to check it out.

@jjtolton
Copy link
Contributor

jjtolton commented Dec 9, 2020

Tested, works great. Approved! Thanks for the guidance, @sogaiu

@PlumpMath
Copy link

It's like watching an (White Snake/A Chinese Ghost Story).
What a beautiful world.

@sogaiu
Copy link
Author

sogaiu commented Dec 9, 2020

@jjtolton Thanks for taking a look and testing!

My current feeling is that perhaps the current code can give folks a taste of what can be done to customize clj-kondo's behavior for use with libpython-clj.

I'm fine to consider / work on some other bits once it's clear there are specific requests -- though may be in many cases it will be easy enough for other folks to contribute too :)

How does that sound?

@jjtolton
Copy link
Contributor

jjtolton commented Dec 9, 2020

I think it's great. We'll get some docs together on how to use it!

@jjtolton jjtolton merged commit f8ce2b2 into clj-python:master Dec 9, 2020
@jjtolton jjtolton changed the title WIP: clj-kondo hooks clj-kondo hooks Dec 9, 2020
@sogaiu
Copy link
Author

sogaiu commented Dec 10, 2020

Sorry if this is off-topic, hope it will be tolerated :)

@PlumpMath I don't understand the reference -- would you mind giving some hints?

@PlumpMath
Copy link

PlumpMath commented Dec 10, 2020

@sogaiu
I'm not sure about that either.
We don't even know forever? hahaha
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants